<!-- 侧边栏 -->
<template>
    <!-- <div> -->
    <!-- element菜单组件 -->
    <!-- <template v-for="userMenu in userMenuList"> -->
    <!-- 一级菜单 -->
    <el-submenu :index="userMenu.path"
        v-if="!userMenu.action && userMenu.menuType === 1 && userMenu.children && userMenu.children?.length">
        <template slot="title">
            <i :class="userMenu.icon"></i>
            <span style="margin-left: 15px;">{{ userMenu.menuName }}</span>
        </template>
        <!-- 二级菜单 -->
        <!-- <AsideMenu :userMenuList="userMenu.children"/> -->
        <AsideMenu :userMenu="item" v-for="item in userMenu.children" />
    </el-submenu>
    <!-- 二级菜单 -->
    <!-- <template  v-else-if="(userMenu.action && userMenu.menuType === 1) || (!userMenu.children && userMenu.menuType === 1)"> -->
    <el-menu-item
        v-else-if="(userMenu.action && userMenu.menuType === 1) || (!userMenu.children && userMenu.menuType === 1)"
        :index="userMenu.path" style="margin-left: 15px;">
        {{ userMenu.menuName }}
    </el-menu-item>
    <!-- </template> -->
    <!-- </template> -->
    <!-- </div> -->
</template>

<script>
export default {
    name: "AsideMenu",
    components: {
        AsideMenu: () => import('@/components/asideMenu_digui.vue'),
    },
    props: {
        // 父组件需要传入用户菜单列表
        userMenuList: {
            type: Array,
            default: () => [],
        },
        userMenu: {
            type: Object,
            default: () => { },
        }
    },
    data() {
        return {

        };
    },
    computed: {},
};
</script>

<style lang="scss" scoped></style>